package Puzzle_Sliding;

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
		/* This first puzzle is easy to solve.
		   1 4 2
		   3   5
		   6 7 8 */
		int[] puzzle = {1, 4, 2, 3, 0, 5, 6, 7, 8};

		/* This second puzzle is more difficult.
		   2 6 7
		     5 1
		   8 3 4 */
//		int[] puzzle = {2, 6, 7, 0, 5, 1, 8, 3, 4};

		/* This third puzzle is even harder.
		   7 2 4
		   5   6
		   8 3 1 */
//		int[] puzzle = {7, 2, 4, 5, 0, 6, 8, 3, 1};

		/* This forth puzzle is the most difficult yet, but the solution sequence
		   follows a simple pattern.
		   8 7 6
		   5 4 3
		   2 1   */
//		int[] puzzle = {8, 7, 6, 5, 4, 3, 2, 1, 0};

		/* This fifth puzzle is one of the two puzzles with the longest solution
		   sequence.
		   8 7 6
		     4 1
		   2 5 3 */
//		int[] puzzle = {8, 7, 6, 0, 4, 1, 2, 5, 3};

		SlidingPuzzle start = new SlidingPuzzle(puzzle);
		SlidingPuzzle goal = new SlidingPuzzle(start.getSize());

		BreadthFirstSearch.solve(start, goal);
//		DepthFirstSearch.solve(start, goal);
	}
}